package com.architecture.core.entity;

import javax.persistence.*;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * LoginAction: Administrator
 * Date: 12-5-4
 * Time: 下午1:55
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "CORE_RESOURCE")
public class Resource extends BaseEntity {

    @ManyToMany(fetch = FetchType.LAZY, targetEntity = Permission.class, cascade = CascadeType.ALL, mappedBy = "resourceList")
    private List<Permission> permissionList;

    @Column(name = "RES_KEY")
    private String key;                     //当前资源的关键字

    @Column(name = "RES_CODE")
    private long resCode;                   //资源代码

    public List<Permission> getPermissionList() {
        return permissionList;
    }

    public void setPermissionList(List<Permission> permissionList) {
        this.permissionList = permissionList;
    }

    public long getResCode() {
        return resCode;
    }

    public void setResCode(long resCode) {
        this.resCode = resCode;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }
}
